<?php
	
	$firstname = $_REQUEST['firstName'];
	$lastname = $_REQUEST['lastName'];
	$email = $_REQUEST['inputEmail'];
	
	$url = "http://localhost:8080/moms-diary/services/registration";

	$ch = curl_init($url);
	$query = http_build_query(
				array(
					"mail" => $email,
					"firstName" => $firstname, 
					"lastName" => $lastname, 
					"invitationId" => "")
				);
	curl_setopt($ch, CURLOPT_HEADER, true);
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $query);

	curl_exec($ch);
	$getinfo =  curl_getinfo($ch);
	curl_close($ch);
	if($getinfo["http_code"] == '201') {
		header("Location: signupout.php?firstname=$firstname&lastname=$lastname&email=$email");
		//kasih liat halaman kaya abis posting sesuatu di kaskus yang isinya berhasil posting terus di redirect ke halaman sebelumnya.
	}

